#-------------------------------------------------------------------------------
# Name:        settings
# Purpose:
#
# Author:      Administrator
#
# Created:     04-07-2014
# Copyright:   (c) Administrator 2014
# Licence:     <your licence>
#-------------------------------------------------------------------------------

import web

urls = (
    '/','handler.Home.Home',
    '/weixin','handler.Weixin.Weixin',
)

def _create_db():
    # local environment
    host = '127.0.0.1'
    db = 'bbtest'
    port = 3306
    user = 'root'
    password = 'root'
    try:
        import sae.const
        db = sae.const.MYSQL_DB
        user = sae.const.MYSQL_USER
        password = sae.const.MYSQL_PASS
        host = sae.const.MYSQL_HOST
        port = int(sae.const.MYSQL_PORT)
    except ImportError:
        pass
    return web.database(dbn='mysql', port = port,db=db, user=user, pw=password,host=host)

db = _create_db()

if __name__ == '__main__':
    main()